[Top] [Prev] [Next] [Bottom] [Contents]

SaGetAffectedRowCount

Returns the affected row count for the last executed object binding.

Synopsis

#include "WorkingDialog.h"
int SaGetAffectedRowCount();

Arguments

None.

Return Values

An integer representing the rows affected by the last request from the database.

Description

SaGetAffectedRowCount returns the last affected row count for an object binding and works for all DSQL Objects including those that perform Select, Insert, Update and Delete.

It also returns the number of rows selected in a query for a Stored Procedure. Its value is not valid for Insert, Update and Delete.

Depending upon its use, SaGetAffectedRowCount returns the number of rows selected in the last select statement for Sybase Stored Procedures which have multiple result groups.

To create a conditional binding:

1. Call a server application using an anchor or a submit button, then make a binding to the first results page. Here the data would be displayed, with an anchor to the next page, which would either be the success page or the "no results" page. The number of rows at the top of this HTML document by editing the Activator Code for this bind as follows:
	/* In the "After Object Binding Execution Code" window */
	printf("%d", SaGetAffectedRowCount());
2. Make two NULL bindings from the anchor on my first results page: one to the "no results" page, and one to the "success" page. Edit the activator code as follows:
	For bind 2 ("no results"):
	/* Before Object Binding Execution Code */
	if (SaGetAffectedRowCount() = 0) {
	/* After Object Binding Execution Code */
      }
	For bind 3 ("success"):
	/* Before Object Binding Execution Code */
	if (SaGetAffectedRowCount() >= 1) {
	/* After Object Binding Execution Code */
	}

See Also



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.